 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 <%

 if(session.getAttribute("user")==null){
 
   RequestDispatcher rd=request.getRequestDispatcher("./LoginForm.jsp");
  rd.forward(request,response);
   
 %>
 <%} %>

  <html>
  
   <head>
 
 <script language="JavaScript" src="<%=request.getContextPath()+"/scripts/gen_validatorv31.js"%>" type="text/javascript"></script>



</head>
  


 <body>
 <jsp:include page="Header.jsp"></jsp:include>
   <br/>
 <center>
			<%
				if (request.getAttribute("status") != null) {
			%>
			<b><font color="red"><%=request.getAttribute("status")%></font> </b>
			<%
				}
			%>
		</center>
  <center><b><h4>District Entry Form</h4></b></center>
   
	
		<form action="<%=request.getContextPath()+"/AddDistrictAction"%>" name="login">
		
		
		<table cellspacing=2 align="center" bgcolor="#87CEEB" width="325" height="60">
		
				<tr><td align='right'><b>StateName :</b></td><td>
				 <select name="stateid" id="select">
				<option>--SELECT--</option>
				<c:if test="${not empty statevector}">
				<c:forEach var="State" items="${statevector}">
				<option value="${State.stateid}">${State.sname}</option>
				</c:forEach>
				</c:if>
				
				</select>
				
				
				</td></tr>
				
				<tr><td align='right'><b>DistrictName :</b></td><td> <input type=text name="dname" /></td></tr>
				<tr><td align='right'><input type=submit value="Add District"/></td><td><input type=submit value=Clear /></td></tr>
	    </table>
   </form>
    <script language="JavaScript" type="text/javascript">
//You should create the validator only after the definition of the HTML form
  var frmvalidator  = new Validator("login");

  frmvalidator.addValidation("dname","req","District Name is required");
    frmvalidator.addValidation("dname","alpha","District Name is Only Characters");

  </script>
  <br/>
     <jsp:include page="Footer.jsp"></jsp:include>
  </body>
</html>
